package service

import (
	"context"
	"gitlab.cqcb.com/shangyou_mic/dscm-approve-api-pb/api/roses/v1"

	"rosesbff/internal/biz"
)

type Common struct {
	v1.UnimplementedCommonServer

	basic   *biz.Basic
	common  *biz.Common
	account *biz.Account
}

func NewCommon(
	basic *biz.Basic,
	common *biz.Common,
	account *biz.Account,
) *Common {
	return &Common{
		basic:   basic,
		common:  common,
		account: account,
	}
}

func (s *Common) LoadSystemConfig(ctx context.Context, req *v1.LoadSystemConfigRequest) (*v1.LoadSystemConfigReply, error) {
	return s.common.LoadSystemConfig(ctx, req)
}

func (s *Common) SaveSystemConfig(ctx context.Context, req *v1.SaveSystemConfigRequest) (*v1.SaveSystemConfigReply, error) {
	return s.common.SaveSystemConfig(ctx, req)
}

func (s *Common) Login(ctx context.Context, req *v1.LoginRequest) (*v1.LoginReply, error) {
	return s.account.Login(ctx, req)
}

func (s *Common) MobileCode(ctx context.Context, req *v1.MobileCodeRequest) (*v1.MobileCodeReply, error) {
	return s.basic.MobileCode(ctx, req)
}

func (s *Common) SystemConfigLists(ctx context.Context, req *v1.SystemConfigListsRequest) (*v1.SystemConfigListsReply, error) {
	return s.common.SystemConfigLists(ctx, req)
}

func (s *Common) SystemConfigUpdate(ctx context.Context, req *v1.SystemConfigUpdateRequest) (*v1.SystemConfigUpdateReply, error) {
	return s.common.SystemConfigUpdate(ctx, req)
}

func (s *Common) TopicLists(ctx context.Context, req *v1.TopicListsRequest) (*v1.TopicListsReply, error) {
	return s.common.TopicLists(ctx, req)
}

func (s *Common) WechatLoginAuthUrl(ctx context.Context, req *v1.WechatLoginAuthUrlRequest) (*v1.WechatLoginAuthUrlReply, error) {
	return s.common.WechatLoginAuthUrl(ctx, req)
}
func (s *Common) WechatLoginCallback(ctx context.Context, req *v1.WechatLoginCallbackRequest) (*v1.WechatLoginCallbackReply, error) {
	return s.common.WechatLoginCallback(ctx, req)
}

func (s *Common) WechatLoginScan(ctx context.Context, req *v1.WechatLoginScanRequest) (*v1.LoginReply, error) {
	return s.common.WechatLoginScan(ctx, req)
}
